<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1">
  <title>记忆课堂</title>
  <link href="/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <style>
    #app {
      margin-top: 30px;
    }
    .adminLoginBox {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
    .mb-15 {
      margin-bottom: 20px;
    }
    small {
      color: orange;
    }
    .list {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .list li {
      margin-top: 20px;
      height: 50px;
      background: #eee;
      text-align: center;
      line-height: 50px;
      border-radius: 5px;
    }
  </style>
</head>
<body>
  
  <div id="app" class="clearfix container col-md-6 col-xs-12 col-md-offset-3"> 
    <h3 class="text-center">Site Setting</h3>
    <p class="text-center">
      <span class="text-muted">The best preparation for tomorrow is doing your best today.</span>
      <small>对明天做好的准备就是今天做到最好！</small>
    </p> 

  </div>



  <script type="text/javascript" src="http://xjzheng.cn/lib/vue.js"></script>
  <script src="http://xjzheng.cn/lib/vue-resource.min.js"></script>
  <script>

    Vue.use(VueResource)

    new Vue({
      el: '#app',
      data: {
        list: [],
        checking: false,
        checkItem: {},
        logined: false,
        admin: {
          user: '',
          password: ''
        },

      },
      mounted: function () {
        
        // this.$http.get('/admin/check').then(function (res) {
        //   if (res.data.code == 100) {
        //     this.logined = true
        //   } else {
        //     location.href = 'http://' + location.hostname + ':' + location.port + '/admin/loginPage'
        //   }
        // })

      },
      methods: {
        toCheck: function (item) {
          this.checkItem = item
          this.checking = true
        },
        adminLogin: function (ev) {
          ev.preventDefault()

          this.$http.get('/admin/login', {
            params: this.admin
          }).then(function (res) {
            console.log(res.data)
            if (res.data.code == 100) {
              sessionStorage.memoryClassAdmin = true
              this.logined = true
            } else {
              alert(res.data.msg)
            }
          })
        }
      }
    })

  </script>
</body>
</html>